#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>

#define BUFFER_SIZE 1024
//刷新方式
#define NONE_FLUSH (1<<0)
#define LINE_FLUSH (1<<1)
#define FULL_FLUSH (1<<2)


typedef struct MY_IO_FILE{
  int _fileno;//文件描述符
  char _stat_buffer[BUFFER_SIZE];//缓冲区
  int _buffer_len;//当前缓冲区存储的数据个数
  int _flush_strategy;//刷新方式
  int _flags;//打开方式
}MY_FILE;


MY_FILE* MYfopen( const char * filename, const char * mode);
int MYfclose(MY_FILE * stream); 
int MYfflush(MY_FILE* stream);
size_t MYfwrite ( const void * ptr, size_t size, size_t count, MY_FILE* stream );
